<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\ClubInfoSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '管理俱乐部';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="club-info-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('创建俱乐部', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'club_id',
            'image',
            'name',
            'rank',
            'user_id',
                         [
                'header' => '查看战绩',
                'format'=>'raw',
                'value' => function($data){
                            
                        // return '<a class="btn btn-success" href="/basic/web/index.php?UserPokerSearch[user_id]='.$data->user_id.'&r=user-poker/index">查看战绩</a>';
                    return '<a class="btn btn-success" href="/basic/web/index.php?r=club-info%2Fmyuser&id='.$data->club_id.'">查看俱乐部战绩</a>';
                            
                            
            }],
            // 'ts',
            // 'status',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
